package org.agpsoft.simpledatareceiver;

import org.agpsoft.datareceiverinfrastructure.builder.IDataReceiverMainHandler;
import org.agpsoft.datareceiverinfrastructure.exception.DataReceiverCloseException;
import org.agpsoft.datareceiverinfrastructure.exception.DataReceiverException;
import org.agpsoft.datareceiverinfrastructure.exception.DataReceiverOpenException;
import org.agpsoft.datareceiverinfrastructure.facade.IDataReceiverFacade;

public class SimpleHandler implements IDataReceiverMainHandler {

	IDataReceiverFacade decoder;
	
	/**
	 * @param decoder
	 */
	public SimpleHandler(IDataReceiverFacade decoder) {
		super();
		this.decoder = decoder;
	}
	
	@Override
	public void handle() throws DataReceiverException {
		decoder.requestDataProcess();
	}

	@Override
	public void close() throws DataReceiverCloseException {
		decoder.close();
	}

	@Override
	public void open(Object context) throws DataReceiverOpenException {
		decoder.open(context);
	}
}
